
#ifndef	__TC_FETCAB_AUBIN_HPP_2010__
#define	__TC_FETCAB_AUBIN_HPP_2010__

#include <vector>
#include <string>


#include <boost/thread/mutex.hpp>

#include "binindex.hpp"


namespace   fetcab   {

class   Aubin
{

public  :
    Aubin( const char* ini_filename, const char* ini_section );
    ~Aubin();

public  :
    int insert( const std::string& kpin,
             const std::string& key,
             const std::string& data );

	/*
    int insertAppend( const std::string& kpin,
             const std::string& key,
             const std::string& data );

    int insertIgnore( const std::string& kpin,
             const std::string& key,
             const std::string& data );
	*/

    int find( const std::string& kpin,
             const std::string& key,
                   std::string& data );

	/*
    int find( const std::string& kpin,
             const std::string&  key,
                   std::vector< std::string >& data,
				   u_int32_t     limit = 0 );
	*/

    int erase( const std::string& kpin,
               const std::string& key );

	//int	slim( void );

public  :

	/*
    virtual int     insertAppend( const std::vector< std::string >& kpin,
                                  const std::vector< std::string >& key,    
                                  const std::vector< std::string >& data );
	*/

private :

    const std::string   getSkeyByKpin( const std::string& kpin );

private :

    std::string _data_root;

	boost::mutex	_mutex;
	boost::mutex	_mutex_read;
    
private :
	BinIndex	_bin_index;

};  //// class Aubin


}   //// namespace fetcab


#endif	////	__TC_FETCAB_AUBIN_HPP_2010__

